package util;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;

public class conexion {
	public static Connection obtenerConexion()  {
		Connection con = null;
		try {
			Class.forName("com.mysql.jdbc.Driver");
			
			//con = DriverManager.getConnection("jdbc:mysql://localhost/tienda", "root", "mysql");
			con = DriverManager.getConnection("jdbc:mysql://localhost/sistemadiadecampo", "root", "pass@word123");
		} catch (ClassNotFoundException e) {
			e.printStackTrace();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return con;
	}
	
	
}
